<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>

        .box1{
            width: 200px;
            height: 200px;
            background-color: yellowgreen;
            display: table-cell;
            vertical-align: middle;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color: green;
            margin: 0 auto;
        }


        table{
            width: 50%;
            border: 1px solid black;
            /* border-spacing  指定边框之间的距离 */
            /* border-spacing:  0px; */

            /* border-collapse合并边框 */
            border-collapse: collapse;
        }
        td{
            border: 1px solid;
            height: 100px;
            /* td中默认垂直居中的  可以通过vertical-align和text-align改变 */
            vertical-align: middle;
            text-align: center;

        }
        /* odd是奇数行 */
        tr:nth-child(2n){
            background-color: yellowgreen;
        }

        /* 
            tr不是table的子元素
            如果table之后没有创建tbody直接使用tr，那么浏览器会自动创建一个tbody，并将所有tr放进tbody里
        */
    </style>
</head>
<body>
    <div class="box1">
        <div class="box2"></div>
    </div>
    <table>
        <tr>
            <td>学号</td>
            <td>姓名</td>
            <td>性别</td>
            <td>年龄</td>
            <td>地址</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>18</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>18</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>18</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>18</td>
            <td>花果山</td>
        </tr>
        <tr>
            <td>1</td>
            <td>孙悟空</td>
            <td>男</td>
            <td>18</td>
            <td>花果山</td>
        </tr>
    </table>
</body>
</html>